<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //类的声明
    class Computer{
      //属性   为 Computer 实例对象添加属性
      brand;
      price;
      name='电脑';
      playMusic = function(){
        console.log('play music....');
      }

      //方法
      //构造方法   作用: 初始化实例对象
      // 构造方法中的 this 指向的是实例对象
      constructor(brand, price){
        this.brand = brand;
        this.price = price;
      }

      //一般方法
      playMusic(){
        console.log('播放音乐....');
      }
    }

    //继承
    class BiJiBen extends Computer{
      //构造方法
      constructor(weight, size, brand, price){
        //调用父类的构造方法
        super(brand, price);
        //初始化子类的属性
        this.weight = weight;
        this.size = size;
      }

      playMusic(){
        console.log('正在播放音乐....');
      }
    }


    // console.log(zjz);
    // zjz.playMusic();

    //实例化子类
    let huipu = new BiJiBen('2KG', '15.6inch','惠普', 1588);
    // console.log(huipu);
    huipu.playMusic();


    class A{}

    let C = {
      A: A
    }

    class B extends C.A{}

    let b = new B();

    console.log(b);
  </script>
</body>
</html>